// $codepro.audit.disable numericLiterals
/**
 * uses view package
 */
package javamonsters.view;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

/**
 * MainPanel is the main pane;
 * 
 * @author elahurd3
 * @version 1.0
 */
public class MainPanel extends JPanel implements View {
	
	/**
	 * suppress warnings
	 */
	@SuppressWarnings("unused")
	
	/**
	 * title screen view instance variable
	 */
	private final TitleScreenView main;
	
	/**
	 * suppress warnings
	 */
	@SuppressWarnings("unused")
	
	/**
	 * config view instance variable
	 */
	private final ConfigView config;
	
	/**
	 * suppress warnings
	 */
	@SuppressWarnings("unused")
	
	/**
	 * dual universe panel instance variable
	 */
	private final DualUniversePanel dual;
	
	/**
	 * suppress warnings
	 */
	@SuppressWarnings("unused")
	
	/**
	 * marketplace view instance varaible
	 */
	private final MarketplaceView marketplaceView;
	
	/**
	 * suppress warnings
	 */
	@SuppressWarnings("unused")
	
	/**
	 * ship yard view instance varaible
	 */
	private final ShipYardView shipYardView;
	
	/**
	 * card layout instance variable
	 */
	private final CardLayout card;
	
	/**
	 * current size dimension instance variable
	 */
	private Dimension currSize;
	
	/**
	 * Constructor for MainPanel
	 * 
	 * @param main main panel
	 * @param config config view
	 * @param dual dual universe panel
	 * @param marketplaceView marketplace view
	 * @param shipYardView shipyard view
	 */
	public MainPanel(TitleScreenView main, ConfigView config, DualUniversePanel dual,
			MarketplaceView marketplaceView, ShipYardView shipYardView) {
		card = new CardLayout(0, 0);
		super.setPreferredSize(new Dimension(700, 380));
		super.setBackground(Color.BLACK);
		super.setLayout(card);
		this.main = main;
		this.config = config;
		this.dual = dual;
		this.marketplaceView = marketplaceView;
		this.shipYardView = shipYardView;
		super.add(main, "Main Menu");
		super.add(config, "Configuration Screen");
		super.add(dual, "Dual Universe Panel");
		super.add(marketplaceView, "Marketplace View");
		super.add(shipYardView, "Ship Yard View");
	}
	
	/**
	 * Returns the CardLayout
	 * @return the CardLayout
	 */
	public CardLayout getLayout() {
		return card;
	}
	
	/**
	 * Returns the Dimension for size
	 * @return the Dimension for size
	 */
	public Dimension getCurrSize() {
		return currSize;
	}
	
	/**
	 * Sets the size with a Dimension object
	 * @param d the Dimension object
	 */
	public void setCurrSize(Dimension d) {
		currSize = d;
	}

}
